<template>
  <div class="section_common">
    <div class="main">
      <el-form ref="form" label-width="100px">

        <el-form-item label="部门" required>
          <el-input v-model="deptName" size="mini" readonly></el-input>
        </el-form-item>

        <el-form-item label="岗位" required>
          <el-input v-model="positionName" size="mini" readonly></el-input>
        </el-form-item>

        <el-form-item label="指定内推组别">
          <el-radio-group v-model="zdGroup">
            <el-radio  label="是">是</el-radio>
            <el-radio  label="否">否</el-radio>
          </el-radio-group>

        </el-form-item>
        <el-form-item label="组别名称" required v-if="this.zdGroup=='是'">
          <el-input v-model="groupName" size="mini"></el-input>
        </el-form-item>

        <el-form-item label="内推日期" required>
          <el-input v-model="pushTime" size="mini" readonly></el-input>
        </el-form-item>

        <el-form-item label="被推荐人姓名">
          <el-input v-model="uname" size="mini"></el-input>
        </el-form-item>

        <el-form-item label="英语等级">
          <el-input v-model="english" size="mini"></el-input>
        </el-form-item>

        <el-form-item label="性别" required>
          <el-input v-model="sexName" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="联系方式" required>
          <el-input v-model="uphone" size="mini"></el-input>
        </el-form-item>


        <el-form-item label="推荐人" required>
          <el-input v-model="pushName" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="推荐人岗位" required>
          <el-input v-model="pushDeptName" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="关系" required>
          <el-input v-model="relation" size="mini"></el-input>
        </el-form-item>

        <el-form-item label="附件简历" required>
          <!--<el-input id="file" v-model="fileName" type="text" readonly/>-->
          <a :href="fileNameUrl" style="color: #3285ff" target=“_blank”>{{fileName}}</a>
        </el-form-item>

        <el-form-item label="内推状态" required>
          <el-input v-model="state" size="mini"></el-input>
        </el-form-item>

        <el-form-item id="reason" style="display: none" label="驳回原因" required>
          <el-input v-model="reason" size="mini"></el-input>
        </el-form-item>

      </el-form>
    </div>
  </div>
</template>

<script>
  import Vue from 'vue';
  /*import pdf from "vue-pdf";*/
  import { Image as VanImage ,Picker,Popup,Dialog,Overlay} from 'vant';
  Vue.use(Picker);
  Vue.use(Popup);
  Vue.use(VanImage);
  Vue.use(Dialog)
  Vue.use(Overlay);
export default {
  /*components: {
    pdf,
  },*/
  data() {
    return {
      title:"内推详情",
      nowUser:"",
      pid:"",
      deptName:"",//部门名称
      positionName:"",//岗位名称
      pushTime:"",
      uname:"",
      sexName:"",
      pushName:"",
      pushDeptName:"",
      relation:"",
      uphone:"",
      state:"",
      attachment:"",
      fileName:"",
      fileNameUrl:"",
      reason:"不合适",
      message:"同意",
      message1:"驳回",
      isShow:false,
      show:false,
      currentPage: 1, // pdf文件页码
      pageCount: 100, // pdf文件总页数
      fileType: "pdf", // 文件类型
      pdfshow:false,
      zdGroup:"",
      groupName:"",
      english:"",
    };
  },
  created() {
    this.pid=this.$route.params.id;
    this.getDetail();//找到对应的页面详情，及领导信息
  },

  methods: {

    //根据传递的招聘申请id获取相应的申请信息
    getDetail(){
      //console.log(id)
      this.$https.post('/mobiles/selPushDetail', {
        pid:this.pid,
      }).then((res)=>{

        this.deptName=res.data.data.deptName;
        this.positionName=res.data.data.positionName;
        this.pushTime=res.data.data.pushTime;
        this.uname=res.data.data.uname;
        this.sexName=res.data.data.sexName;
        this.pushName=res.data.data.pushName;
        this.pushDeptName=res.data.data.pushDeptName;
        this.relation=res.data.data.relation;
        this.state=res.data.data.state;
        this.uphone=res.data.data.uphone;
        this.attachment=res.data.data.attachment;
        this.fileName=res.data.data.fileNameTip;
        this.fileNameUrl=res.data.data.fileNameUrl;
        //this.fileNameUrl = pdf.createLoadingTask(res.data.data.fileNameUrl);
        //console.log(this.fileNameUrl)
        this.reason=res.data.data.reason;
        this.zdGroup=res.data.data.zdGroup;
        this.groupName=res.data.data.groupName;
        this.english=res.data.data.english;

      }).catch(err => {
        console.log(err);
      })
    },

    preview(){
      //document.getElementById("preview").style.display= "";
      //this.pdfshow=true;
      this.$router.push({path: "/sp/pdfPreview/" + this.attachment});
    }

  },
};
</script>

<style lang="scss" scoped>
.main {
  display: flex;
  justify-items: center;
  margin: 0 auto;
  .el-form {
    padding-right: 10px;
    .el-form-item {
      .el-form-item__label {
        line-height: 16px;
      }
      margin-bottom: 5px;
    }
  }
}
</style>